package br.com.assemble.hermeserp.model.pojos.enderecamento;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import br.com.assemble.hermeserp.ejb.annotation.DaoClass;
import br.com.assemble.hermeserp.model.BasePojo;
import br.com.assemble.hermeserp.model.pojos.comercial.Divisao;


/**
 * The persistent class for the MUNICIPIOS database table.
 * 
 */
@Entity
@Table(name="MUNICIPIOS")
@DaoClass(value="MunicipioDao", pu="hermes-pu")
public class Municipio extends BasePojo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="MUN_IDENTIFY", unique=true, nullable=false)
	private BigInteger munIdentify;

	@Column(name="MUN_CODIGO_IBGE", nullable=false)
	private Integer munCodigoIbge;

	@Column(name="MUN_DDD", unique=true, nullable=false)
	private Integer munDdd;

	@Column(name="MUN_NOME", nullable=false, length=100)
	private String munNome;

	//bi-directional many-to-one association to Bairro
	@OneToMany(mappedBy="municipio")
	private List<Bairro> bairroCollection;

	//bi-directional many-to-one association to Divisao
	@OneToMany(mappedBy="municipio")
	private List<Divisao> divisaoCollection;

	//bi-directional many-to-one association to Unidade
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="UND_IDENTITY", nullable=false)
	private Unidade unidade;

    public Municipio() {
    }

	public BigInteger getMunIdentify() {
		return this.munIdentify;
	}

	public void setMunIdentify(BigInteger munIdentify) {
		this.munIdentify = munIdentify;
	}

	public Integer getMunCodigoIbge() {
		return this.munCodigoIbge;
	}

	public void setMunCodigoIbge(Integer munCodigoIbge) {
		this.munCodigoIbge = munCodigoIbge;
	}

	public Integer getMunDdd() {
		return this.munDdd;
	}

	public void setMunDdd(Integer munDdd) {
		this.munDdd = munDdd;
	}

	public String getMunNome() {
		return this.munNome;
	}

	public void setMunNome(String munNome) {
		this.munNome = munNome;
	}

	public List<Bairro> getBairroCollection() {
		return this.bairroCollection;
	}

	public void setBairroCollection(List<Bairro> bairroCollection) {
		this.bairroCollection = bairroCollection;
	}
	
	public List<Divisao> getDivisaoCollection() {
		return this.divisaoCollection;
	}

	public void setDivisaoCollection(List<Divisao> divisaoCollection) {
		this.divisaoCollection = divisaoCollection;
	}
	
	public Unidade getUnidade() {
		return this.unidade;
	}

	public void setUnidade(Unidade unidade) {
		this.unidade = unidade;
	}
	
}